<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div class="gv-page-container" fxLayout="column">
  <a [routerLink]="['..']" class="gv-back-link"><small><< Back to applications</small></a>
  <h1>New application</h1>
  <div class="gv-page-content" fxLayout="row">
    <mat-horizontal-stepper linear labelPosition="bottom" fxFlex="70" #stepper="matHorizontalStepper">
      <ng-template matStepperIcon="edit">
        <mat-icon>check</mat-icon>
      </ng-template>
      <mat-step>
        <ng-template matStepLabel>
          <h5>Platform</h5>
          <small>Application type</small>
        </ng-template>
        <application-creation-step1 [application]="application"></application-creation-step1>
        <div fxLayout="row" fxLayoutAlign="end end" class="stepper-button-zone">
          <button mat-raised-button color="primary" matStepperNext type="button"[disabled]="!application.type">Next</button>
        </div>
      </mat-step>
      <mat-step>
        <ng-template matStepLabel>
          <h5>Settings</h5>
          <small>Application configuration</small>
        </ng-template>
        <application-creation-step2 *ngIf="stepper.selectedIndex == 1" [application]="application"></application-creation-step2>
        <div class="stepper-button-zone">
          <button mat-raised-button matStepperPrevious type="button">Back</button>
          <span fxFlex></span>
          <button mat-raised-button color="primary" (click)="create()" [disabled]="!stepperValid()">Create</button>
        </div>
      </mat-step>
    </mat-horizontal-stepper>
    <div class="gv-page-description" fxFlex>
      <h3>Application ?</h3>
      <div class="gv-page-description-content">
        <p>Applications are used by users to log in and access protected resources.</p>
        <p>Applications can be mobile native applications, frontend applications, web applications or backend applications.</p>
      </div>
    </div>
  </div>
</div>
